// 执行一次上传
import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useUploadStore = defineStore(
  'upload',
  () => {
    const hasUploaded = ref(false) // 更清晰的命名

    const setUploaded = (value) => {
      hasUploaded.value = value
    }

    return {
      hasUploaded,
      setUploaded
    }
  },
  {
    persist: {
      key: 'upload-status', // 自定义存储键名
      paths: ['hasUploaded'] // 明确指定要持久化的字段
    }
  }
)